package com.heima.admin.controller.v1;

import com.heima.feign.wemedia.ISensitiveClient;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.wemedia.dtos.SensitiveDto;
import com.heima.model.wemedia.pojos.WmSensitive;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author rookie001
 * @creat 2023-06-19-14:49
 */
@RequestMapping("/api/v1/sensitive")
@RestController
@Slf4j
public class AdSensitiveController {
    @Autowired
    private ISensitiveClient sensitiveClient;
   @PostMapping("list")
    public ResponseResult list(@RequestBody SensitiveDto dto){
       return sensitiveClient.list(dto);
   }
    //删除
    @DeleteMapping("/del/{id}")
    public ResponseResult del(@PathVariable Integer id){
        return sensitiveClient.del(id);
    }

    //保存
    @PostMapping("save")
    public ResponseResult save(@RequestBody WmSensitive wmSensitive){
       return sensitiveClient.save(wmSensitive);
    }

    //修改
    @PostMapping("update")
    public ResponseResult update(@RequestBody WmSensitive wmSensitive){
        return sensitiveClient.update(wmSensitive);
    }
}
